<?php

namespace Admin\Controller;

use Admin\Controller\IndexController;
use Zend\View\Model\ViewModel;
use Admin\Model\DBO\UserDBO;

class SuccessController extends IndexController {

    public function indexAction() {

        // Lay thong tin nguoi 
        $roleID = $this->getRole();
        switch ($roleID) {
            case 2:
                $this->redirect()->toRoute('cataloging-document');
                break;
            case 3:
                $this->redirect()->toRoute('ciculation-management');
                break;
        }
        $viewModel = new ViewModel();
        $this->layout()->identity = $this->getAuthService()->getIdentity();
        return $viewModel;
    }

    public function errorRoleAction() {
        $viewModel = new ViewModel();
        $this->layout()->identity = $this->getAuthService()->getIdentity();
        return $viewModel;
    }

}